﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;

namespace CivilleWP7.Views.Controls
{
    public partial class ExploreTileControl : UserControl
    {
        private int type;

        public int Type
        {
            get { return type; }
            set 
            { 
                type = value;
                var myBrush = new ImageBrush();
                if (value == 0)
                {
                    this.TypeTextBlock.Text = "Carbon";
                    this.DescriptionTextBlock.Text = "Let's have some fun!";
                    this.Logo.Source = new BitmapImage(new Uri("/CivilleWP7;component/Resources/Images/carbon.png", UriKind.Relative));
                    BitmapImage image = new BitmapImage(new Uri("/CivilleWP7;component/Resources/Images/task_back.jpg", UriKind.Relative));
                    myBrush.ImageSource = image;
                }
                if (value == 1)
                {
                    this.TypeTextBlock.Text = "Diamond";
                    this.DescriptionTextBlock.Text = "Let's do some good!";
                    this.Logo.Source = new BitmapImage(new Uri("/CivilleWP7;component/Resources/Images/diamond.png", UriKind.Relative));
                    BitmapImage image = new BitmapImage(new Uri("/CivilleWP7;component/Resources/Images/task_back.jpg", UriKind.Relative));
                    myBrush.ImageSource = image;      
                }
                myBrush.Stretch = Stretch.UniformToFill;
                this.LayoutRoot.Background = myBrush;
            }
        }
        public ExploreTileControl()
        {
            InitializeComponent();
        }
    }
}
